<template>
  <div>
    <div id="aaa"></div>
    <button @click="print">打印</button>
    <!-- <button @click="print2">批量打印</button> -->

  </div>
</template>
<script>
import { getClientNoTemplate } from './print-template/clientNoTemplate'
export default {
  name: 'HelloWorld',
  data() {
    return {}
  },
  mounted() {
  },
  methods: {
    print() {
      const $hiprintTemplate = new this.$pluginName.PrintTemplate({
        template: getClientNoTemplate()
      })
      const space = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
      const space1 = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
      const data = [
        {
          warehouseName: '济南仓库',
          cousumer: '110010-山东阿迪嗷嗷销售有限公司',
          year: '2024',
          month: '2',
          date: '21',
          items: [
            { itemCode: 'K00B80600', itemName: '电脑电脑电K00B80600电脑电脑电K00B80600电脑电脑电K00B80600', unit: '个', qty: 1 },
            { itemCode: 'K00B80602', itemName: '电脑电脑电K00B80600', unit: '个', qty: 2 },
          ],
          wwpOrder: space+'64020240221000001',
          orderLineNo: space+'1',
          orderNo: space1+'481070907',
          address: space+'山东省济南市历城区xx街道xx号',
          p1: '黄XX',
          p2: '朱JJ',
          p3: '刘伟',
          idCard: '123456789012345678',
          carNo: '粤B12345',
        },
        {
          warehouseName: '济南仓库',
          cousumer: '110010-山东阿迪嗷嗷销售有限公司',
          year: '2024',
          month: '2',
          date: '21',
          items: [
            { itemCode: 'K00B80600', itemName: '电脑电脑电K00B80600', unit: '个', qty: 1 },
            { itemCode: 'K00B80602', itemName: '电脑电脑电K00B8061', unit: '个', qty: 2 },
            { itemCode: 'K00B80603', itemName: '电脑电脑电K00B80611', unit: '个', qty: 3 },
          ].slice(1),
          wwpOrder: '64020240221000001',
          orderLineNo: '1',
          orderNo: '481070907',
          address: '山东省济南市历城区xx街道xx号',
          p1: '黄XX',
          p2: '朱JJ',
          p3: '刘伟',
          idCard: '123456789012345678',
          carNo: '粤B12345',
        },
      ]
      $hiprintTemplate.print(data, {});
    }
  }
}

</script>